# -*- coding: utf-8 -*-

"""
Description:
"""
from utils.file_operation import load_json_to_dict,save_dict_to_json

# 解决重复商品问题
data_list = load_json_to_dict("total_list_with_desc.json")
product_ids = []
res_list = []
for item in data_list:
    if item["id"] in product_ids:
        continue
    for _item in item["specifications"]:
        product_ids.append(_item["productId"])
    res_list.append(item)

save_dict_to_json(res_list, "res_list_test.json")